class Solution
{
public:
    int minimumSwap(string s1, string s2)
    {
        int a = 0, b = 0;
        for (int i = 0; i < s1.size(); i ++ )
            if (s1[i] != s2[i])
                if (s1[i] == 'x') a ++ ;
                else b ++ ;

        if ((a + b) % 2) return -1;
        if (a % 2) return (a + b) / 2 + 1;
        return (a + b) / 2;
    }
};
//想要均匀分,那么上下不同的总个数 上y下x+上x下y==sum  sum%2==0 才能均分

